home *** CD-ROM | disk | FTP | other *** search
- /* System-dependent definitions of various files, spool directories, etc */
- #include "global.h"
- #include "files.h"
-
- char *Startup = "NOS-Startup";
- char *NOSDial = "NOS-Dial";
- char *Config = "Config.NOS"; /* Device configuration list */
- char *Hostfile = "NOS.rc";
- char *Userfile = "FTPusers";
- char *LogsDir = "Logs";
- char *Mailspool = "Spool/Mail";
- char *Mailqdir = "Spool/Mqueue";
- char *Mailqueue = "Spool/Mqueue/#?.WRK";
- char *Routeqdir = "Spool/Rqueue"; /* queue for router */
- char *Alias = "Alias"; /* the alias file */
- char *Dfile = "Domain.TXT"; /* Domain cache */
- char *Fdir = "Finger"; /* Finger info directory */
- char *Arealist = "Spool/Areas"; /* List of message areas */
- char *Helpdir = "Spool/Help"; /* help file directory */
- char *Rewritefile = "Spool/Rewrite"; /* Address rewrite file */
- char *Signature = "Spool/Signature"; /* Mail signature file directory */
- char *Popusers = "POPusers"; /* POP user and password file */
- char *Newsdir = "Spool/News"; /* News messages and NNTP data */
- char *Newsqueue = "Spool/News/#?.WRK";
- char *Forwardfile = "Spool/Forward.BBS"; /* Mail forwarding file */
- char *Historyfile = "Spool/History"; /* Message ID history file */
- char *Chatnode = "Chatnode.CFG"; /* Chatnode */
- char *SignOn = "Spool/Signon"; /* SignOn files Mbox, FTP, TTY. */
- char *Digger = "Digger"; /* where Digger topics are held */
- char *DiggerC = "Digger/Cache"; /* where Digger topics are held */
- char *Spoolqdir = "Spool";
-
- #define SEPARATOR ":"
-
- static char *strcatdup __ARGS((char *a,char *b,char *c));
-
- /* Establish a root directory other than the default. Can only be called
- * once, at startup time
- */
- void initroot(root)
- char *root;
- {
- Startup = strcatdup(root,SEPARATOR,Startup);
- NOSDial = strcatdup(root,SEPARATOR,NOSDial);
- Userfile = strcatdup(root,SEPARATOR,Userfile);
- Hostfile = strcatdup(root,SEPARATOR,Hostfile);
- LogsDir = strcatdup(root,SEPARATOR,LogsDir);
- Mailspool = strcatdup(root,SEPARATOR,Mailspool);
- Mailqdir = strcatdup(root,SEPARATOR,Mailqdir);
- Mailqueue = strcatdup(root,SEPARATOR,Mailqueue);
- Routeqdir = strcatdup(root,SEPARATOR,Routeqdir);
- Alias = strcatdup(root,SEPARATOR,Alias);
- Dfile = strcatdup(root,SEPARATOR,Dfile);
- Fdir = strcatdup(root,SEPARATOR,Fdir);
- Arealist = strcatdup(root,SEPARATOR,Arealist);
- Helpdir = strcatdup(root,SEPARATOR,Helpdir);
- Rewritefile = strcatdup(root,SEPARATOR,Rewritefile);
- Signature = strcatdup(root,SEPARATOR,Signature);
- Popusers = strcatdup(root,SEPARATOR,Popusers);
- Newsdir = strcatdup(root,SEPARATOR,Newsdir);
- Newsqueue = strcatdup(root,SEPARATOR,Newsqueue);
- Forwardfile = strcatdup(root,SEPARATOR,Forwardfile);
- Historyfile = strcatdup(root,SEPARATOR,Historyfile);
- Chatnode = strcatdup(root,SEPARATOR,Chatnode);
- SignOn = strcatdup(root,SEPARATOR,SignOn);
- Digger = strcatdup(root,SEPARATOR,Digger);
- DiggerC = strcatdup(root,SEPARATOR,DiggerC);
- Spoolqdir = strcatdup(root,SEPARATOR,Spoolqdir);
- }
-
- /* Concatenate three strings into a malloc'ed output buffer */
- static char *strcatdup(a,b,c)
- char *a,*b,*c;
- {
- char *out,*p1,*p2;
-
- out = mallocw(strlen(a) + strlen(b) + strlen(c) + 1);
- strcpy(out,a);
- strcat(out,b);
- strcat(out,c);
- if(*b != '\0'){
- /* Remove any repeated occurrences of the separator char */
- p1 = p2 = out;
- while(*p2 != '\0'){
- *p1++ = *p2++;
- while(p2[0] == p2[-1] && p2[0] == b[0])
- p2++;
- }
- *p1 = '\0';
- }
- return out;
- }
-
-